<template>
	<view class="userinfo-container">
		<cc-navbar></cc-navbar>
		<view class="info-cell-group">
			<view class="info-cell" v-for="(item, index) in columns" :key="index">
				<view class="info-cell-left font-info">
					{{ item.label }}
				</view>
				<view class="info-cell-right">
					{{ userInfo[item.prop] || '--' }}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				columns: [{
						label: '用户名',
						prop: 'realname'
					},
					{
						label: '用户角色',
						prop: 'roleName'
					},
					{
						label: '手机号码',
						prop: 'phone'
					}
				]
			};
		},
		onLoad() {
			this.initPage();
		},
		methods: {
			async initPage() {
				await this.$store.dispatch('GetInfo');
			}
		}
	};
</script>

<style lang="scss" scoped>
	@import './index.scss';
</style>